
import { CreateDate, Entity, UpdateDate, Title, PrimaryUuid, Cover, Desc, Boolean, Remark, Digdit, Jsonb } from '@sker/core'

@Entity({ name: 'gym_place' })
export class GymPlace {
    static title: string = `场地`;
    static resource: string = `gym_place`;

    @PrimaryUuid({ primaryKeyConstraintName: 'PK_GYM_PLACE_ID' })
    id!: string;

    @Title({ comment: '场所名' })
    title!: string;

    @Jsonb({ comment: '排班时间', nullable: true })
    time_range: Date[];

    @Jsonb({ label: '排班信息', nullable: true })
    week_times: {week: string[],times: any[]}[];

    @Cover({ nullable: true })
    cover!: string;

    @Desc({ nullable: true })
    desc!: string;

    @Boolean({ default: true })
    status: boolean

    @Remark({ nullable: true })
    reason: string;

    @Digdit({ comment: '可容纳人数', default: 0 })
    max: number;

    @Digdit({ comment: '最小人数', default: 0 })
    min: number;

    @CreateDate({
        comment: '创建日期'
    })
    create_date!: Date;

    @UpdateDate({
        comment: '更新日期'
    })
    update_date!: Date;
}